package com.weixinli.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.weixinli.beans.UserInfo;
import com.weixinli.dao.IUserInfoDao;

@Repository("iUserInfoDao")
public class UserInfoDaoImpl implements IUserInfoDao {
	@Resource(name="sqlSession")
	private SqlSession sqlSession;

	public void setSqlSession(SqlSession sqlSession) {
		this.sqlSession = sqlSession;
	}

	public int addUserInfo(UserInfo ui) {
		sqlSession.insert("register", ui);
		return ui.getW_uid();
	}

	public List<UserInfo> getPageUserInfo(Integer pageNo, Integer pageSize) {
		return null;
	}

	public int getTotalUserInfo() {
		return 0;
	}

	public int delUserInfo(Integer w_uid) {
		return 0;
	}

	public UserInfo userLogin(UserInfo uf) {
		return sqlSession.selectOne("userInfoDao.userLogin", uf);
	}

	public UserInfo userTest(UserInfo uf) {
		return sqlSession.selectOne("userTest", uf);
	}

}
